(function() {
	module('ChessBoardModel Tests');

	test('Setup OK', function() {
		ok(true);
	});

	test('canPlace on empty board', function() {
		var model = new ChessBoardModel(4);
		equal(model.canPlaceAt(0, 2), true);
	});

	test('cannot place (same row)', function() {
		var model = new ChessBoardModel(4);

		model.placeAt(0, 0);

		equal(model.canPlaceAt(0, 2), false);
	});

	test('cannot place (same col)', function() {
		var model = new ChessBoardModel(4);

		model.placeAt(0, 0);

		equal(model.canPlaceAt(2, 0), false);
	});

	test('cannot place (LR same diagonal)', function() {
		var model = new ChessBoardModel(4);

		model.placeAt(0, 0);

		equal(model.canPlaceAt(2, 2), false);
	});

	test('cannot place (RL same diagonal)', function() {
		var model = new ChessBoardModel(4);

		model.placeAt(2, 1);

		equal(model.canPlaceAt(0, 3), false);
	});

	test('can place', function() {
		var model = new ChessBoardModel(4);

		model.placeAt(1, 1);

		equal(model.canPlaceAt(3, 2), true);
	});

	test('test in progress', function() {
		var model = new ChessBoardModel(4);

		equal(model.placeAt(1, 0), true);
		equal(model.placeAt(0, 2), true);
		equal(model.placeAt(2, 3), true);

		equal(model.isSolved(), false);
	});

	test('test stale', function() {
		var model = new ChessBoardModel(4);

		equal(model.placeAt(0, 0), true);
		equal(model.placeAt(2, 1), true);
		equal(model.placeAt(1, 3), true);

		equal(model.isSolved(), false);
		equal(model.isStale(), true);
	});

	test('test solution', function() {
		var model = new ChessBoardModel(4);

		equal(model.placeAt(1, 0), true);
		equal(model.placeAt(3, 1), true);
		equal(model.placeAt(0, 2), true);
		equal(model.placeAt(2, 3), true);

		equal(model.isSolved(), true);
	});

}());